<template>
  <div class="button_box_container">
    <el-button type="primary" @click="remove">退出登录</el-button>
  </div>
</template>
<script>
export default {
  methods: {
    remove() {
      this.$http("http://ceshi5.dishait.cn/admin/logout", "post")
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
          localStorage.removeItem("token");
          this.$router.push({ path: "/login" });
          alert("退出成功")
        });
    },
  },
};
</script>
<style lang="scss">

</style>